<?php

class PicBoardException extends Exception {

	public function __construct($message, $code = 0, Exception $previous = null){
		if(SYS_RUNMODE == 1){
			// Throw the exception to the user
			parent::__construct($message, $code);
		} else {
			// Log error to database and show a nice friendly error to the user.
		}
	
	}
	
	public function __toString() {
		return __CLASS__ . ": [{$this->code}]: {$this->message}\nStackTrace: {$this->trace}";
	}

}

?>